public class A_Tests {

	public static eBayAPI ebay = new eBayAPI();
	
	public static void doGetUser() {

		ebay.setupSecurity('GetUser');
		
		GetUserRequestType.GetUserRequestType_e gur = new GetUserRequestType.GetUserRequestType_e();
		gur.Version = '561';
		gur.DetailLevel = new String[]{'ReturnAll'};
		gur.UserID = 'testuser_djcarroll';
 
		GetUserResponseType.GetUserResponseType_e guResponse = ebay.GetUser(gur);

		System.debug(guResponse);
		if (guResponse.Ack == 'Failure') {
			System.debug(guResponse.Errors[0].LongMessage);
		} else {
			System.debug('Email address: ' + guResponse.User_x.Email);
			//System.debug('Reg Address: ' + guResponse.User_x.RegistrationAddress.Name);
			System.debug('Reg Address: ' + guResponse.User_x.RegistrationAddress.Street);
			System.debug('Reg Address: ' + guResponse.User_x.RegistrationAddress.CityName);
			System.debug('Reg Address: ' + guResponse.User_x.RegistrationAddress.StateOrProvince);
			System.debug('Reg Address: ' + guResponse.User_x.RegistrationAddress.Country);
			System.debug('Reg Address: ' + guResponse.User_x.RegistrationAddress.CountryName);
			System.debug('Reg Address: ' + guResponse.User_x.RegistrationAddress.Phone);
			System.debug('Reg Address: ' + guResponse.User_x.RegistrationAddress.PostalCode);
		}
	}
	public static void doAddItem() {
		ebay.setupSecurity('AddItem');

		AddItemRequestType.AddItemRequestType_e gur = new AddItemRequestType.AddItemRequestType_e();

		gur.Version = '563'; 
		gur.DetailLevel = new String[]{'ReturnAll'};
		gur.Item = new ItemType.ItemType_e();
		gur.Item.Country = 'US';
		gur.Item.Currency_x = 'USD';
		gur.Item.Description = 'This is a full description of the item.';
		gur.Item.ListingDuration = 'Days_7';
		gur.Item.Location = 'San Francisco, CA';
		gur.Item.PaymentMethods = new List<String>{'PayPal', 'VisaMC'};
		gur.Item.PayPalEmailAddress = 'djcarroll@gmail.com';
		gur.Item.PrimaryCategory = new CategoryType.CategoryType_e();
		gur.Item.PrimaryCategory.CategoryId = '279';
		gur.Item.Quantity = 3;
		gur.Item.StartPrice = '25.99';
		gur.Item.Title = 'Creating On-demand Applications';
		gur.Item.ApplyShippingDiscount = false;
		gur.Item.AutoPay = false;
		gur.Item.MotorsGermanySearchable = false;
		gur.Item.BuyerProtection = 'ItemIneligible';
		gur.Item.BuyItNowPrice = '50.00';
		gur.Item.CategoryMappingAllowed = true;
		 
		AddItemResponseType.AddItemResponseType_e guResponse = ebay.AddItem(gur);
	}
	
	public static void doItemList() {
		ebay.setupSecurity('GetMyeBaySelling');
		 
		GetMyeBaySellingRequestType.GetMyeBaySellingRequestType_e sellingRequest = new GetMyeBaySellingRequestType.GetMyeBaySellingRequestType_e();

		sellingRequest.setVersion('563');
		
		ItemListCustomizationType.ItemListCustomizationType_e alist = new ItemListCustomizationType.ItemListCustomizationType_e();
		alist.setListingType('Auction'); 
		sellingRequest.setActiveList(alist);
		
		GetMyeBaySellingResponseType.GetMyeBaySellingResponseType_e resp = ebay.GetMyeBaySelling(sellingRequest);
		System.debug('Get Items: ' + resp.Ack);
	} 
	

}